import HomeView from "@/views/LostPropertyPostView.vue";
import { RouteRecordRaw } from "vue-router";

import LoginView from "@/views/LoginView.vue"
import RegisterView from "@/views/RegisterView.vue"
import Index from "@/views/Index.vue"
import FindView from "@/views/Details.vue"
import PublishView from "@/views/PublishView.vue"
import UserView from "@/views/UserView.vue"
import AboutView from "@/views/AboutView.vue"
import UpdateView from "@/views/UpdateView.vue"
import ChatAIView from "@/views/ChatAIView.vue"
import PublishCardView from "@/views/PublishCardView.vue"
import FilePreviewView from "@/views/FilePreviewView.vue"
import {ref} from "@vue/reactivity";
import PromoteView from "@/views/PromoteView.vue"
import EditKnowledgeView from "@/views/EditKnowledgeView.vue"
import CreateChartView from "@/views/CreateChartView.vue"
export const routes: Array<RouteRecordRaw> = [
  {
    path: "/",
    name: "校园交友",
    component: Index,
  },
  {
    path: "/about",
    name: "校园失物",
    component: HomeView,

  },
  {
    path: "/login",
    name: "登录模块",
    component: LoginView,
    meta: {
      hideInMenu: true,
    },
  },
  {
    path: "/register",
    name: "注册模块",
    component: RegisterView,
    meta: {
      hideInMenu: true,
    },
  },
  {
    path: "/detail",
    name: "失物讨论",
    component: FindView,
    meta: {
      keepAlive: true,
      hideInMenu: true,
    }
  },

  {
    path: "/publish",
    name: "发布帖子",
    component: PublishView,

  },
  {
    path: "/find",
    name: "发布个人帖子",
    component: PublishCardView,
    meta: {
      hideInMenu: true,
    },
  },

  {
    path: "/chart",
    name: "AI智能图表",
    component: CreateChartView,

  },

  {
    path: "/user",
    name: "个人中心",
    component: UserView,
    children: [
      {
        name: '基本信息',
        path: '/base',
        component: AboutView,
      },
      {
        name: '修改信息',
        path: '/refactor',
        component: UpdateView,
      },

    ]

  },

  {
    path: "/promote",
    name: "知识宣传栏",
    component: PromoteView,

  },
  {
    path: "/express",
    name: "用户管理",
    meta: {
      role: 1,

    },
    component: () =>
      import( "../views/ManageUserView.vue"),
  },

];

